<?php

namespace App\Observers;

use App\Models\AttributeGroup;

class AttributeGroupObserver
{
    public function deleting(AttributeGroup $group)
    {
	    if (has_child($group, 'products')) {
		    abort(403, '检测到对应商品');
	    }
        if (has_child($group, 'attributeKeys')) {
        	abort(403, '检测到组内属性');
        }
    }
}
